
<%@ page import="com.asisto.model.Servicio" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Edit Servicio</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Servicio List</g:link></span>
            <span class="menuButton"><g:link class="create" action="create">New Servicio</g:link></span>
        </div>
        <div class="body">
            <h1>Edit Servicio</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${servicioInstance}">
            <div class="errors">
                <g:renderErrors bean="${servicioInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <input type="hidden" name="id" value="${servicioInstance?.id}" />
                <input type="hidden" name="version" value="${servicioInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cliente">Cliente:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'cliente','errors')}">
                                    <g:select optionKey="id" from="${com.asisto.model.Cliente.list()}" name="cliente.id" value="${servicioInstance?.cliente?.id}" ></g:select>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lastUpdated">Last Updated:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'lastUpdated','errors')}">
                                    ${servicioInstance?.lastUpdated?.toString()}
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="dateCreated">Date Created:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'dateCreated','errors')}">
                                    ${servicioInstance?.dateCreated?.toString()}
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="fechaFin">Fecha Fin:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'fechaFin','errors')}">
                                    <g:datePicker name="fechaFin" value="${servicioInstance?.fechaFin}" precision="minute" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="fechaInicio">Fecha Inicio:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'fechaInicio','errors')}">
                                    <g:datePicker name="fechaInicio" value="${servicioInstance?.fechaInicio}" precision="minute" ></g:datePicker>
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="importe">Importe:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'importe','errors')}">
                                    <input type="text" id="importe" name="importe" value="${fieldValue(bean:servicioInstance,field:'importe')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="numeroHoras">Numero Horas:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'numeroHoras','errors')}">
                                    <input type="text" id="numeroHoras" name="numeroHoras" value="${fieldValue(bean:servicioInstance,field:'numeroHoras')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="tipo">Tipo:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:servicioInstance,field:'tipo','errors')}">
                                    <input type="text" id="tipo" name="tipo" value="${fieldValue(bean:servicioInstance,field:'tipo')}"/>
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
